package com.rdc.example.dao;

import com.rdc.example.bean.dto.ArticleDTO;
import com.rdc.example.entity.Article;
import com.rdc.example.entity.User;

import java.util.List;

/**
 * @author duck
 */
public interface ArticleDao {
    boolean insert(Article article) throws Exception;

    boolean deleteById(Integer id) throws Exception;

    boolean update(Article article) throws Exception;

    boolean updateTime(Integer id) throws Exception;

    boolean addColumn(Integer id, Integer columnId) throws Exception;

    boolean removeColumn(Integer id) throws Exception;

    boolean setTop(Integer id) throws Exception;

    boolean cancelTop(Integer id) throws Exception;

    boolean addLike(Integer id) throws Exception;

    boolean reduceLike(Integer id) throws Exception;

    Article getArticleById(Integer id) throws Exception;

    List<Article> listArticleByUserId(Integer userId) throws Exception;

    List<Article> listArticle() throws Exception;

    List<Article> listArticleByColumnId(Integer columnId) throws Exception;

    List<Article> listArticleSortByLikesDesc() throws Exception;

    List<Article> listArticleSortByUpdatedAtDesc() throws Exception;

    List<Article> getArticleListByIds(List<Integer> articleIds);

    List<Article> searchArticlesByTitle(String keyword) throws Exception;
}
